<div class="abs-full"><div class="for-scroll">
    <div class="message-list">
        <div class="item">
            <div class="title">银行卡下架通知</div>
            <div class="time">2017-33-33 00:00:00</div>
        </div>
        <div class="item">
            <div class="title">银行卡下架通知</div>
            <div class="time">2017-33-33 00:00:00</div>
        </div>
        <div class="item">
            <div class="title">银行卡下架通知</div>
            <div class="time">2017-33-33 00:00:00</div>
        </div>
    </div>
    <div class="zxf_pagediv"></div>  
    <div style="height:100px;"></div>
</div></div>

<style type="text/css">
    .message-list .item {
        height: 73px;
        border-bottom: 1px solid rgba(0,0,0,0.2);
        padding: 0px 10px 0px 10px;
        font-size: 14px;
        color: #000;
    }
    .message-list .item .title {
        line-height: 40px;
        opacity: 0.8;
    }
    .message-list .item .time {
        opacity: 0.5;
    }
</style>
<script>
    $("#center-top .home").hide();
    $("#center-top .back").show();
    $("#center-top .menu").hide();

    Util.queryTemplate($(".message-list"), ".zxf_pagediv", null, function(page, size, cb) {
        CMD.notice_uquery(undefined, undefined, size, page, cb);
    }, function(table, list) {
        if (Util.isEmpty(list)) {
            table.append("<div class='empty'>暂无数据</div>");
            _mainScroll.refresh();
            return;
        }
        var l = '<div class="item" value="__id__">\
            <div class="title">__title__</div>\
            <div class="time">__t__</div>\
        </div>';

        for (var i in list) {
            var d = Util.convertNotice(list[i]);
            var l2 = l.replace(/__id__/, d.id);
            l2 = l2.replace(/__title__/, d.subject);
            l2 = l2.replace(/__t__/, d.time);          
            table.append(l2);  
        }
        _mainScroll.refresh();

        table.find(".item").click(function(e) {
            var id = $(e.currentTarget).attr("value");
            for (var i in list) {
                if (list[i].id == id) {
                    var d = Util.convertNotice(list[i]);
                    _showNoticeDetail(d);
                    if (!d.forever) CMD.notice_flag_read(id);
                    return;
                }
            }
        });
    });

    function _showNoticeDetail(data) {
        $("#message-detail .pop_title").html(data.subject);
        $("#message-detail .pop_content").html(data.content);
        $("#message-detail").modal({
            width: $(document).width() - 30,
        });
    }

    var _mainScroll;
    $(function() {
        _mainScroll = new IScroll(".abs-full", {
            scrollX: false,
            scrollY: true,
            click: true,
        })
    })
</script>